/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitybean;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ShahanThai
 */
@Entity
@Table(name = "Artists", catalog = "SharingMusic", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Artists.findAll", query = "SELECT a FROM Artists a"),
    @NamedQuery(name = "Artists.findByArtistID", query = "SELECT a FROM Artists a WHERE a.artistID = :artistID"),
    @NamedQuery(name = "Artists.findByArtistName", query = "SELECT a FROM Artists a WHERE a.artistName = :artistName")})
public class Artists implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue
    @Basic(optional = false)
    @Column(name = "ArtistID", nullable = false)
    private int artistID;
    @Basic(optional = false)
    @Column(name = "ArtistName", nullable = false, length = 50)
    private String artistName;
    @OneToMany(mappedBy = "artists")
    private List<Songs> songsList;

    public Artists() {
    }

    public Artists(int artistID) {
        this.artistID = artistID;
    }

    public Artists(String artistName) {
        this.artistName = artistName;
    }

    public Artists(int artistID, String artistName) {
        this.artistID = artistID;
        this.artistName = artistName;
    }

    public int getArtistID() {
        return artistID;
    }

    public void setArtistID(int artistID) {
        this.artistID = artistID;
    }

    public String getArtistName() {
        return artistName;
    }

    public void setArtistName(String artistName) {
        this.artistName = artistName;
    }

    public List<Songs> getSongsList() {
        return songsList;
    }

    public void setSongsList(List<Songs> songsList) {
        this.songsList = songsList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash = this.artistID;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Artists)) {
            return false;
        }
        Artists other = (Artists) object;
        if (this.artistID != other.artistID) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitybean.Artists[artistID=" + artistID + "]";
    }

}
